import { createSlice ,createAsyncThunk} from "@reduxjs/toolkit"
import {getMovieRequest} from "../../api/getMovieRequest"
export const getMovieAction = createAsyncThunk('movie/getMovieList',async()=>{
 const re =   await getMovieRequest()
  return re.data.data.list
})

 const movieSlice = createSlice({
    name:"movie",
    initialState:{
        movie:[]
    },
    reducers:{
        
    },
    extraReducers:{
        [getMovieAction.fulfilled](prev,{payload}){
          prev.movie =  payload
        }
    }
})



export default movieSlice.reducer